#ifndef Assignment2_H
#define Assignment2_H

#include "Engine.h"

#include <OgreEntity.h>
#include "PlayerRiotShield.h"
#include "PlayingField.h"
#include "ScoreCard.h"
#include "FlashBang.h"
#include "NetworkHandler.h"
#include "ServerRiotShield.h"
#include "ClientRiotShield.h"
#include "ClientControlResponder.h"
#include "ServerScoreCard.h"
#include "ClientScoreCard.h"
#include "ServerFlashBang.h"
#include "ClientFlashBang.h"

class Paddle
{
public:
	Paddle( const char* name );
	~Paddle();

	void input( const InputSet& is );
	void update();

	Ogre::Entity* en;
	Ogre::SceneNode* sn;
	Ogre::Vector3 pos;
	Ogre::Vector3 vel;
};

/*
Assignment 2.
*/

class Assignment2 : public State
{
public: // State implementation
	virtual ~Assignment2() {}

	virtual void init( Engine* game );
	virtual void cleanup( Engine* game );

	virtual void input( Engine* game );
	virtual void update( Engine* game );
	virtual void draw( Engine* game );

	virtual void setCaption( std::ostringstream& buffer );

public: // Singleton pattern
	static State* Instance();
protected:
	Assignment2();

public: // Functions

private: // Functions

private: // Members
	int frames_elapsed;
	//PlayerRiotShield *player;
	ServerRiotShield *player1;
	ServerRiotShield *player2;
	ClientRiotShield *player1V;
	ClientRiotShield *player2V;
	ClientControlResponder *controlRes;
	PlayingField *field;
	//ScoreCard *score;
	ServerScoreCard *score1;
	ServerScoreCard *score2;
	ClientScoreCard *score1V;
	ClientScoreCard *score2V;
	//FlashBang *grenade;
	ServerFlashBang *grenade;
	ClientFlashBang *grenadeV;
	//Paddle *a, *b;
	NetworkHandler *server;
	NetworkHandler *client;
	bool isServer;
};

#endif

